package com.czk.demo.service;

import com.czk.spring.*;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/3/31 9:50
 */
@Component
@Lazy
// @Scope("prototype")
public class UserService implements BeanNameAware,InitializingBean {
    @Autowired
    private User user;

    public void test() {
        System.out.println(user);
    }

    @Override
    public void setBeanName(String beanName) {
        // 生成的beanName
        System.out.println(beanName);
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("执行自己初始化后的逻辑");
    }
}
